package com.cro.prison.entity.constant;/**
 * @author augus
 * @create 2022-11-22-13:55
 */

/**
 * @ClassName:BEHAVIORTYPEENUM_PRISONER
 * @Description:TODO
 * @author Augus
 * @date 2022/11/22 13:55
 * @Version 1.0
 **/
public enum BEHAVIORTYPEENUM_PRISONER {
    SLEEP_LATE("晚睡",1),
    LAUGH_ALOUD("大笑",2),
    CRY("哭",3);
    private String name;
    private Integer code;

    BEHAVIORTYPEENUM_PRISONER(String name, Integer code) {
        this.name = name;
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public static String getValue(Integer code) {
        for (BEHAVIORTYPEENUM_PRISONER value : BEHAVIORTYPEENUM_PRISONER.values()) {
            if (value.getCode().equals(code)) {
                return value.getName();
            }
        }
        return null;
    }

    public static Integer getCode(String name) {
        for (BEHAVIORTYPEENUM_PRISONER value : BEHAVIORTYPEENUM_PRISONER.values()) {
            if (value.getName().equals(name)) {
                return value.getCode();
            }
        }
        return null;
    }
}
